/*
 * @Author: huangjinyao huangjinyao@hjy.cn
 * @Date: 2024-07-02 09:21:10
 * @LastEditors: huangjinyao huangjinyao@hjy.cn
 * @LastEditTime: 2024-07-02 18:51:16
 * @FilePath: \小兔仙项目\vue-rabbit\src\apis\category.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import httpInstance from '@/utils/http'

export function getTopCategoryAPI(id){
    return httpInstance({
        url:'/category',
        method: 'GET',
        params:{
            id
        }
    })
}


/**
 * @description: 获取二级分类列表数据
 * @param {*} id 分类id 
 * @return {*}
 */

export const getCategoryFilterAPI = (id) => {
    return httpInstance({
      url:'/category/sub/filter',
      params:{
        id
      }
    })
  }


  /**
 * @description: 获取导航数据
 * @data { 
     categoryId: 1005000 ,
     page: 1,
     pageSize: 20,
     sortField: 'publishTime' | 'orderNum' | 'evaluateNum'
   } 
 * @return {*}
 */
export const getSubCategoryAPI = (data) => {
  return httpInstance({
    url:'/category/goods/temporary',
    method:'POST',
    data
  })
}